package com.tinyseed.emcp.api.maintenance.domain;

import com.tinyseed.emcp.api.basicdata.domain.Enterprise;
import com.tinyseed.emcp.api.basicdata.domain.Monitor;
import com.tinyseed.emcp.api.exception.entity.ExceptionInfo;
import com.tinyseed.hmxx.common.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @version Revision 1.0.0
 * @版权：
 * @author: Howard
 * @email:
 * @see:
 * @创建日期：2020/3/14
 * @功能说明：维保信息表
 * @begin
 * @修改记录:
 * @修改后版本 修改人        修改内容
 * @2020/3/14 wuxiran        创建
 * @end
 */
@Data
@Entity
@Table(name = "tb_Maintenance_info")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@DynamicInsert
@DynamicUpdate
public class MaintenanceInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "maintenance_info_seq")
    @SequenceGenerator(sequenceName = "maintenance_info_sequence", name = "maintenance_info_seq_id", allocationSize = 1)
    private Long id;

    @ManyToOne
    @JoinColumn(name = "exception_info_id")
    private ExceptionInfo exceptionInfo;

    @ManyToOne
    @JoinColumn(name = "enterprise_id")
    private Enterprise enterprise;

    /**
     * 监测点id
     */
    @OneToOne
    @JoinColumn(name = "monitor_id")
    private Monitor monitor;

    /**
     * 维保登记人
     */
    @Column(length = 32)
    private String mtRegistrant;
    /**
     * 维保登记联系电话
     */
    @Column(length = 32)
    private String mtRegistrantPhone;
    /**
     * 维保登记时间
     */
    @Column()
    private Timestamp mtRegistrationTime;
    /**
     * 维保登记原因
     */
    @Column()
    private String mtRegistrationReason;
    /**
     * 维保要求
     */
    @Column()
    private String mtRequirements;

    /**
     * 维保下发人
     */
    @Column(length = 32)
    private String mtIssued;

    /**
     * 维保下发人联系电话
     */
    @Column(length = 32)
    private String mtIssuedPhone;

    /**
     * 维保下发时间
     */
    @Column()
    private Timestamp mtIssuedTime;

    /**
     * 维保执行人电话
     */
    @Column(length = 32)
    private String mtExecutivePhone;
    @Column(length = 32)
    private String mtExecutiveName;
    @Column()
    private Timestamp mtStartTime;
    @Column()
    private Timestamp mtEndTime;
    @Column(length = 32)
    private String mtActualSituation;

    /**
     * 状态
     */
    @Column(length = 32)
    private String mtStatus;

    @Column(length = 32)
    private String mtStatusCode;

    @Column()
    private String remark;

}
